package org.jeecg.modules.yc.web.entity;

import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * @Description: 告警记录
 * @Author: jeecg-boot
 * @Date:   2023-12-25
 * @Version: V1.0
 */
@Data
@TableName("alarm_report")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="alarm_report对象", description="告警记录")
public class AlarmReport implements Serializable {
    private static final long serialVersionUID = 1L;

	/**主键*/
	@TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键")
    private String id;
	/**创建人*/
    @ApiModelProperty(value = "创建人")
    private String createBy;
	/**创建日期*/
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建日期")
    private Date createTime;
	/**更新人*/
    @ApiModelProperty(value = "更新人")
    private String updateBy;
	/**更新日期*/
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新日期")
    private Date updateTime;
	/**所属部门*/
    @ApiModelProperty(value = "所属部门")
    private String sysOrgCode;
	/**告警类型*/
	@Excel(name = "告警类型", width = 15)
    @ApiModelProperty(value = "告警类型")
    private String type;
	/**告警设备名称*/
	@Excel(name = "告警设备名称", width = 15)
    @ApiModelProperty(value = "告警设备名称")
    private String deviceName;
	/**告警设备编号*/
	@Excel(name = "告警设备编号", width = 15)
    @ApiModelProperty(value = "告警设备编号")
    private String deviceNo;
	/**是否处理*/
	@Excel(name = "是否处理", width = 15)
    @ApiModelProperty(value = "是否处理")
    private Integer isSolve;
	/**处理人员*/
	@Excel(name = "处理人员", width = 15)
    @ApiModelProperty(value = "处理人员")
    private String solvePersonnel;

    /**图片*/
    @Excel(name = "图片", width = 15)
    private transient java.lang.String imgString;

    private byte[] img;

    public byte[] getImg(){
        if(imgString==null){
            return null;
        }
        return imgString.getBytes(StandardCharsets.UTF_8);
    }

    public String getImgString(){
        if(img==null || img.length==0){
            return "";
        }
        try {
            return new String(img,"UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return "";
    }
}
